{extend name="$_admin_base_layout" /}

{block name="content"}
{notempty name="page_tips_top"}
<div class="alert alert-{$tips_type} alert-dismissable">
    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
    <p>{$page_tips_top|raw}</p>
</div>
{/notempty}
{$extra_html_content_top|raw|default=''}
<div class="row">
    <div class="col-md-12">
        <div class="block">
            {empty name="_pop"}
            <div class="block-header bg-gray-lighter">
                {empty name="tab_nav"}
                <ul class="block-options">
                    <li>
                        <button type="button" class="page-reload"><i class="si si-refresh"></i></button>
                    </li>
                    <li>
                        <button type="button" data-toggle="block-option" data-action="fullscreen_toggle"></button>
                    </li>
                </ul>
                {/empty}
                <h2 class="block-title" style="text-align: center;font-size: 30px;">{$page_title|default=""}</h2>
            </div>
            {/empty}
            {notempty name="tab_nav"}
            <div class="block-header bg-gray-lighter" style="text-align: center">
                <ul class="nav nav-pills" style="display: inline-block;">
                    {volist name="tab_nav['tab_list']" id="tab"}
                    <li {eq name="tab_nav.curr_tab" value="$key"}class="active"{/eq}>
                    <a style="height: 50px;padding: 10px 17px;font-size: 20px;" href="{$tab.url}{$_pop ?= '?_pop=1'}">{$tab.title}</a>
                    </li>
                    {/volist}

                </ul>
                <ul class="block-options">
                    <li>
                        <button type="button" class="page-reload"><i class="si si-refresh"></i></button>
                    </li>
                    <li>
                        <button type="button" data-toggle="block-option" data-action="fullscreen_toggle"></button>
                    </li>
                </ul>
            </div>
            {/notempty}
            {notempty name="tab_nav2"}
            <div class="block-header bg-gray-lighter" style="text-align: center">
                <ul class="nav nav-pills nav2-pills" style="display: inline-block;">
                    <?php $nav2_i = 0;?>
                    {volist name="tab_nav2['tab_list']" id="tab2"}
                    <?php $nav2_i ++;?>
                    <li {eq name="tab_nav2.curr_tab" value="$key"}class="active nav2-active{$nav2_i}"{/eq}>

                    <a style="display: flex;padding: 10px 17px;font-size: 20px;" href="{$tab2.url}{$_pop ?= '?_pop=1'}">
                        {if !empty($tab2.icon)}
                        <button class="btn btn-primary nav2-color nav2-color{$key}" style="width: 55px;height: 55px;border-radius: 100%;">
                            <i class="fa fa-2x {$tab2.icon}"></i>
                            <!--<img style="width: 25px;height: 25px;" src="/xxy/public/static/wh/img/wh0.png" />-->
                        </button>
                        {/if}

                        <div style="padding-left: 10px;font-size: 20px;line-height: 40px;" href="{$tab2.url}{$_pop ?= '?_pop=1'}">{$tab2.title}</div>
                    </a>
                    </li>
                    {/volist}

                </ul>
                <ul class="block-options">
                    <li>
                        <button type="button" class="page-reload"><i class="si si-refresh"></i></button>
                    </li>
                    <li>
                        <button type="button" data-toggle="block-option" data-action="fullscreen_toggle"></button>
                    </li>
                </ul>
            </div>
            {/notempty}
            <div class="tab-content">
                <div class="tab-pane active">
                    <div class="block-content">
                        {$extra_html_form_top|raw|default=''}
                        <form class="form-builder row" name="form-builder" action="{$post_url|default=''}" method="{$_method}">
                            {notempty name="_token_name"}
                            {:token($_token_name, $_token_value)}
                            {/notempty}
                            {empty name="form_items"}
                            {notempty name="empty_tips"}
                            <div class="form-empty">
                                <p class="text-center text-muted empty-info">
                                    <i class="fa fa-database"></i> {$empty_tips|raw}<br>
                                </p>
                            </div>
                            {/notempty}
                            {else /}
                            {volist name="form_items" id="form"}
                            {switch name="form.type"}
                            {case value="archive"}
                            {// 档案文件 }
                            {include file="../application/common/builder/form/items/archive.html" type='' /}
                            {/case}

                            {case value="archives"}
                            {// 多个档案文件 }
                            {include file="../application/common/builder/form/items/archives.html" type='' /}
                            {/case}

                            {case value="bmap"}
                            {// 百度地图 }
                            {include file="../application/common/builder/form/items/bmap.html" type='' /}
                            {/case}

                            {case value="button"}
                            {// 按钮 }
                            {include file="../application/common/builder/form/items/button.html" type='' /}
                            {/case}

                            {case value="checkbox"}
                            {// 多选 }
                            {include file="../application/common/builder/form/items/checkbox.html" type='' /}
                            {/case}

                            {case value="ckeditor"}
                            {// ckeditor编辑器 }
                            {include file="../application/common/builder/form/items/ckeditor.html" type='' /}
                            {/case}

                            {case value="colorpicker"}
                            {// 取色器 }
                            {include file="../application/common/builder/form/items/colorpicker.html" type='' /}
                            {/case}

                            {case value="date"}
                            {// 日期 }
                            {include file="../application/common/builder/form/items/date.html" type='' /}
                            {/case}

                            {case value="daterange"}
                            {// 日期范围 }
                            {include file="../application/common/builder/form/items/daterange.html" type='' /}
                            {/case}

                            {case value="datetime"}
                            {// 日期时间 }
                            {include file="../application/common/builder/form/items/datetime.html" type='' /}
                            {/case}

                            {case value="editormd"}
                            {// markdown编辑器 }
                            {include file="../application/common/builder/form/items/editormd.html" type='' /}
                            {/case}

                            {case value="file"}
                            {// 单文件上传 }
                            {include file="../application/common/builder/form/items/file.html" type='' /}
                            {/case}

                            {case value="files"}
                            {// 多文件上传 }
                            {include file="../application/common/builder/form/items/files.html" type='' /}
                            {/case}

                            {case value="gallery"}
                            {// 图片相册 }
                            {include file="../application/common/builder/form/items/gallery.html" type='' /}
                            {/case}

                            {case value="group"}
                            {// 分组 }
                            {include file="../application/common/builder/form/items/group.html" type='' /}
                            {/case}

                            {case value="hidden"}
                            {// 隐藏 }
                            {include file="../application/common/builder/form/items/hidden.html" type='' /}
                            {/case}

                            {case value="icon"}
                            {// 图标选择器 }
                            {include file="../application/common/builder/form/items/icon.html" type='' /}
                            {/case}

                            {case value="image"}
                            {// 单图片上传 }
                            {include file="../application/common/builder/form/items/image.html" type='' /}
                            {/case}

                            {case value="images"}
                            {// 多图片上传 }
                            {include file="../application/common/builder/form/items/images.html" type='' /}
                            {/case}

                            {case value="jcrop"}
                            {// 图片裁剪 }
                            {include file="../application/common/builder/form/items/jcrop.html" type='' /}
                            {/case}

                            {case value="linkage"}
                            {// 联动下拉框 }
                            {include file="../application/common/builder/form/items/linkage.html" type='' /}
                            {/case}

                            {case value="linkages"}
                            {// 多级联动下拉框 }
                            {include file="../application/common/builder/form/items/linkages.html" type='' /}
                            {/case}

                            {case value="masked"}
                            {// 格式文本 }
                            {include file="../application/common/builder/form/items/masked.html" type='' /}
                            {/case}

                            {case value="number"}
                            {// 数字 }
                            {include file="../application/common/builder/form/items/number.html" type='' /}
                            {/case}

                            {case value="password"}
                            {// 密码 }
                            {include file="../application/common/builder/form/items/password.html" type='' /}
                            {/case}

                            {case value="radio"}
                            {// 单选 }
                            {include file="../application/common/builder/form/items/radio.html" type='' /}
                            {/case}

                            {case value="range"}
                            {// 范围 }
                            {include file="../application/common/builder/form/items/range.html" type='' /}
                            {/case}

                            {case value="select"}
                            {// 下拉菜单 }
                            {include file="../application/common/builder/form/items/select.html" type='' /}
                            {/case}

                            {case value="select2"}
                            {// 下拉多选 }
                            {include file="../application/common/builder/form/items/select2.html" type='' /}
                            {/case}

                            {case value="sort"}
                            {// 排序 }
                            {include file="../application/common/builder/form/items/sort.html" type='' /}
                            {/case}

                            {case value="static"}
                            {// 静态文本 }
                            {include file="../application/common/builder/form/items/static.html" type='' /}
                            {/case}

                            {case value="summernote"}
                            {// summernote编辑器 }
                            {include file="../application/common/builder/form/items/summernote.html" type='' /}
                            {/case}

                            {case value="switch"}
                            {// 开关 }
                            {include file="../application/common/builder/form/items/switch.html" type='' /}
                            {/case}

                            {case value="tags"}
                            {// 标签 }
                            {include file="../application/common/builder/form/items/tags.html" type='' /}
                            {/case}

                            {case value="text"}
                            {// 单行文本 }
                            {include file="../application/common/builder/form/items/text.html" type='' /}
                            {/case}

                            {case value="time"}
                            {// 时间 }
                            {include file="../application/common/builder/form/items/time.html" type='' /}
                            {/case}

                            {case value="textarea|array"}
                            {// 文本框|数组 }
                            {include file="../application/common/builder/form/items/textarea.html" type='' /}
                            {/case}

                            {case value="ueditor"}
                            {// 百度编辑器 }
                            {include file="../application/common/builder/form/items/ueditor.html" type='' /}
                            {/case}

                            {case value="wangeditor"}
                            {// wang编辑器 }
                            {include file="../application/common/builder/form/items/wangeditor.html" type='' /}
                            {/case}
                            {default/}
                            {:extend_form_item($form, $_layout)}
                            {/switch}
                            {/volist}
                            {/empty}
                            <div class="form-group col-md-12 col-xs-12" style="text-align: center;border-radius: 6px;">
                                <div class="col-xs-12">
                                    {php}if(isset($btn_hide) && !in_array('submit', $btn_hide)):{/php}
                                    <button class="btn btn-radius btn-lg btn-minlg btn-primary {$submit_confirm ?= 'confirm '}{$ajax_submit ?= 'ajax-post'}" target-form="form-builder" type="submit">
                                        {$btn_title['submit']|raw|default='提交'}
                                    </button>
                                    {php}endif;{/php}

                                    {empty name="_pop"}
                                    {php}if(isset($btn_hide) && !in_array('back', $btn_hide)):{/php}
                                    <button class="btn btn-radius btn-lg btn-minlg bg-info-light" type="button" onclick="javascript:history.back(-1);return false;">
                                        {$btn_title['back']|raw|default='返回'}
                                    </button>
                                    {php}endif;{/php}
                                    {else/}
                                    <button class="btn btn-radius btn-lg btn-minlg bg-info-light" type="button" id="close-pop">关闭</button>
                                    {/empty}

                                    {// 额外按钮}
                                    {$btn_extra|raw|default=''}
                                </div>
                            </div>
                        </form>
                        {$extra_html_form_bottom|raw|default=''}
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{notempty name="page_tips_bottom"}
<div class="alert alert-{$tips_type} alert-dismissable">
    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
    <p>{$page_tips_bottom|raw}</p>
</div>
{/notempty}
{// 图标 }
{notempty name="_icon"}
<div id="icon_tab" style="display:none">
    <div id="icon_search">
        <form onsubmit="return false;">
            <div class="input-group input-group-lg">
                <div class="input-group-addon">搜索图标</div>
                <input class="js-icon-search form-control" type="text" placeholder="例如: 输入 home 或 user">
            </div>
        </form>
    </div>
    <ul  class="nav nav-tabs nav-simple">
        <li class="active">
            <a href="#fa" data-toggle="tab">Font Awesome</a>
        </li>
        <li>
            <a href="#gl" data-toggle="tab">Glyphicons</a>
        </li>
        <li>
            <a href="#sl" data-toggle="tab">SIMPLE LINE</a>
        </li>
        {volist name="_icons" id="icon"}
        <li>
            <a href="#icon{$icon.id}" data-toggle="tab">{$icon.name}</a>
        </li>
        {/volist}
    </ul>
    <div class="tab-content js-icon-content" style="padding: 10px">
        <div class="tab-pane fade active in" id="fa">
            {include file="../application/common/builder/form/icon/fa.html" /}
        </div>
        <div class="tab-pane fade" id="gl">
            {include file="../application/common/builder/form/icon/gl.html" /}
        </div>
        <div class="tab-pane fade" id="sl">
            {include file="../application/common/builder/form/icon/sl.html" /}
        </div>
        {volist name="_icons" id="icon"}
        <div class="tab-pane fade" id="icon{$icon.id}">
            {$icon.html|raw|default='暂无图标'}
        </div>
        {/volist}
    </div>
</div>
{/notempty}
{$extra_html_content_bottom|raw|default=''}
{/block}

{block name="style"}
{notempty name="_editormd"}
<link href="__LIBS__/editormd/css/editormd.min.css?v={:config('asset_version')}" rel="stylesheet" type="text/css" />
{/notempty}

{volist name="css_list" id="vo"}
<link rel="stylesheet" href="{$vo}?v={:config('asset_version')}">
{/volist}

{// 额外CSS代码 }
{$extra_css|raw|default=''}
{/block}

{block name="script"}
<script>
    $(document).ready(function () {

        //禁用所有input标签回车提交
        $("input").on('keypress',function(e){
            var key = window.event ? e.keyCode : e.which;
            if(key.toString() == "13"){
                return false;
            }
        });
    })
</script>
{notempty name="_ueditor"}
<script src="__LIBS__/ueditor/ueditor.config.js?v={:config('asset_version')}"></script>
<script src="__LIBS__/ueditor/ueditor.all.min.js?v={:config('asset_version')}"></script>
{/notempty}

{notempty name="_ckeditor"}
<script src="__LIBS__/ckeditor/ckeditor.js?v={:config('asset_version')}"></script>
{/notempty}

{volist name="js_list" id="vo"}
<script src="{$vo}?v={:config('asset_version')}"></script>
{/volist}

{// 额外JS代码 }
{$extra_js|raw|default=''}
{/block}